home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / cool / ge_cool.lha / GE_COOL2.1 / src / Association / TODO < prev   
Text File  |  1992-04-13  |  856b  |  27 lines

  1. file: Association.h
  2.  
  3. find
  4.   re-write this to not use reset next and key.  find is heavily used,
  5.   and setting current position inside the loop (instead of using a local
  6.   variable in a register) slows it down
  7. template <class Ktype, class Vtype>
  8. Boolean Association<Ktype,Vtype>::find (const Ktype& key) {
  9.   for (long i = 0; i < this->number_elements; i++) // Search for key in list
  10.    if ((*this->compare_keys_s)(this->data[i].get_first(), key) == TRUE) {
  11.      this->current_position = i;    // Set current position        
  12.      return TRUE;            // Return success
  13.     }
  14.   return FALSE;                // Return failure
  15. }
  16.  
  17. remove()
  18.   re-write to invoke the base class remove() method.
  19.  
  20. remove (const Ktype& key)
  21.   re-write to do a find(key) followed by remove()
  22.  
  23. put
  24.   put needs to call the general purpose protected grow method, that
  25.   Vector should have (see cool/Vector/TODO)
  26.  
  27.